<template>
	<view>
		<uni-nav-bar :fixed="true" left-icon="back" title="服务单详情" @clickLeft="leftBack" background-color="#318cff" color="#fff"></uni-nav-bar>
		<view class="dfj-bg-white dfj-t-666">
			<view class="dfj-pd-20">换货信息</view>
			<view class="dfj-pd-20 dfj-flex dfj-flex-ai-c">
				<view class="dfj-flex-1">服务单号</view>
				<view>{{ info.serviceNo }}</view>
			</view>
			<view class="dfj-pd-20 dfj-flex dfj-flex-ai-c">
				<view class="dfj-flex-1">申请时间</view>
				<view>{{ info.createDate | timestampToTime }}</view>
			</view>
			<view class="dfj-pd-tb-30">
				<uni-steps :options="[{title: '待审核'}, {title: '已审核'}, {title: '已完成'}]" :active="info.progress"></uni-steps>
			</view>
		</view>
	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: ''
			}
		},
		filters: {
			timestampToTime(timestamp) {
				var date = new Date(timestamp); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
				var Y = date.getFullYear() + '-';
				var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
				var D = date.getDate() + ' ';
				var h = date.getHours() + ':';
				var m = date.getMinutes() + ':';
				var s = date.getSeconds();
				return Y + M + D + h + m + s;
			}
		},
		onLoad(options) {
			this.getInfo(options.orderId)
		},
		methods:{
			leftBack() {
				uni.navigateBack();
			},
			getInfo(orderId){
				this.$http({
					url: '/order/queryAfterSales',
					data: {
						orderId: orderId
					},
					dataType: 'json'
				}).then(res=> {
					this.info = res.data[0]
				})
			}
		}
	}
</script>

<style>
</style>
